package ace.module.oauth2.server.core.impl.authorization.oidc.authentication;

import org.springframework.security.oauth2.core.oidc.OidcUserInfo;
import org.springframework.security.oauth2.server.authorization.oidc.authentication.OidcUserInfoAuthenticationContext;

/**
 * @author caspar
 * @date 2023/3/13 9:19 {@link OidcUserInfoMapper} 委托实现
 */
public class DelegateOidcUserInfoMapper implements OidcUserInfoMapper {

  private final OidcUserInfoMapper oidcUserInfoMapper;

  public DelegateOidcUserInfoMapper(OidcUserInfoMapper oidcUserInfoMapper) {
    this.oidcUserInfoMapper = oidcUserInfoMapper;
  }

  @Override
  public OidcUserInfo apply(OidcUserInfoAuthenticationContext oidcUserInfoAuthenticationContext) {
    return oidcUserInfoMapper.apply(oidcUserInfoAuthenticationContext);
  }
}
